package study.javabasic.communication.pipe;

import java.io.IOException;
import java.io.PipedOutputStream;

/**
 * Created by zhangshuhan on 2019/3/21.
 */
public class WriteData {

    public void writeDate(PipedOutputStream out, String content) {

        byte[] strs = content.getBytes();

        try {
            out.write(strs);
            System.out.println("write:"+content);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
